#ifndef _CTRL_H__
#define _CTRL_H__

//#include <atltypes.h>
#include <atlimage.h>
#include<iostream>
using namespace std;

//#include "MainData.h"
class CMainData;
class CCtrl
{

public:
	HWND m_hWnd;
	bool m_bHove;
	bool m_bDown;
	bool m_bDisable;

	int m_iLeftOffset;
	int m_iTopOffset;
	int m_iRightOffset;
	int m_iBottomOffset;

	RECT m_rect;
	POINT m_nowPos;
	POINT m_desPos;

	CString m_name;

	CImage m_image;

	CMainData* m_pMainData;


public:
	CCtrl(HWND hWnd = NULL);
	virtual ~CCtrl();
	
	virtual void SetPos(int x, int y);
	virtual void SetPos(POINT pos);
	virtual void SetPos(int left, int top, int right, int bottom);

	virtual void SetDesPos(int x, int y);
	virtual void SetDesPos(POINT pos);

	
	virtual void SetImage(LPCTSTR strNor);
	virtual void DrawImage(HDC* hdc);
	CImage* GetImage();

	virtual bool OnLBtnDown(POINT pos);
	virtual bool OnLBtnUp(POINT pos);
	virtual bool OnMouseMove(POINT pos);

	virtual bool OnTimer(int TimerID);

};


#endif